// Kony

#pragma once

#include "CoreMinimal.h"
#include "ScalableFloat.h"
#include "Engine/DataAsset.h"
#include "CharacterClassInfo.generated.h"

class UGameplayEffect;
class UGameplayAbility;

//角色枚举
UENUM(BlueprintType)
enum class ECharacterClass : uint8
{
	Elementalist, //法修
	Warrior, //力体修
	Ranger //敏体修
};
//角色默认信息
USTRUCT(BlueprintType)
struct FCharacterClassDefaultInfo
{
	GENERATED_BODY()
	//主要属性 新建角色使用的 数据资产
	UPROPERTY(EditDefaultsOnly, Category = "Class Defaults")
	TSubclassOf<UGameplayEffect> PrimaryAttributes;

	//每个角色可设置的独立启动能力
	UPROPERTY(EditDefaultsOnly, Category = "Class Defaults")
	TArray<TSubclassOf<UGameplayAbility>> StartupAbilities;
	//击杀怪物获取修为值的CT表 ，蓝图设置
	UPROPERTY(EditDefaultsOnly, Category = "Class Defaults")
	FScalableFloat XPReward = FScalableFloat();
	//击杀怪物获取灵气的CT表 ，蓝图设置
	UPROPERTY(EditDefaultsOnly, Category = "Class Defaults")
	FScalableFloat LingQiReward = FScalableFloat();
};

/**
 * 角色类别信息 用于区分不同职业的类别
 */
UCLASS()
class GASC_HUANLING_API UCharacterClassInfo : public UDataAsset
{
	GENERATED_BODY()
public:
	//角色枚举和角色信息Map 用于查询
	UPROPERTY(EditDefaultsOnly, Category = "Character Class Defaults")
	TMap<ECharacterClass,FCharacterClassDefaultInfo> CharacterClassInformation;

	//用于设置读取存档时，设置通过游戏标签动态值 设置主属性 数据资产变量（ 通过存档的 bFirstTimeLoadIn = false 时加载这个资产）
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TSubclassOf<UGameplayEffect> PrimaryAttributes_SetByCaller;
	//次要属性 - 用于敌人加载次要属性的数据资产
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TSubclassOf<UGameplayEffect> SecondaryAttributes_Enemy;
	//次要属性 - 用于玩家读取存档时 更新次要属性游戏能力的 无限时间的次要属性数据资产
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TSubclassOf<UGameplayEffect> SecondaryAttributes_Infinite;
	//核心资源属性
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TSubclassOf<UGameplayEffect> VitalAttributes;
	//角色能力数组
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TArray<TSubclassOf<UGameplayAbility>> CommonAbilities;
	//曲线系数表数组
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults|Damage")
	TObjectPtr<UCurveTable> DamageCalculationCoefficients;
	FCharacterClassDefaultInfo GetCharacterClassDefaultInfo(ECharacterClass CharacterClass);
};
